﻿using CSharpPro._1028;

namespace CSharpPro;

class Program
{
    static void Main(string[] args)
    {
        UserService service = new UserServiceimpl();
        List<User> users = new List<User>();
        service.setlist(users);
        int a =1;
        while (a > 0)
        {
            Console.WriteLine("1. 登录 2. 注册 3. 退出");
            a = int.Parse(Console.ReadLine());
            if (a == 1)
            {
                service.login();
            }
            else if (a == 2)
            {
                service.register();
            }
            else if (a == 3)
            {
                Console.Write("退出");
                break;
            }
            else
            {
                Console.Write("输入错误");
                break;
            }
        }

        foreach (User user in service.getlist())
        {
            Console.WriteLine("user-name:"+user.Name+" user-pwd:"+user.Pwd);
        }
    }
}